<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="姚德秋">
    <title></title>
    <style>
        * {
            box-sizing: border-box;
        }

        ul {
            padding: 0;
            margin: 0;
            list-style: none;
        }

        .box {
            width: 520px;
            height: 280px;
            margin: 100px auto;
            position: relative;
        }

        .indicator {
            width: 100%;
            position: absolute;
            left: 0;
            bottom: 20px;
            display: flex;
            /* justify-content: ; */
            color: white;
        }

        .img-list {
            position: relative;
            top: 0;
            left: 0;
        }

        .indicator li {
            width: 20px;
            height: 20px;
            background-color: #aaa;
            text-align: center;
            line-height: 20px;
            margin: 0 5px;
            border-radius: 50%;
            cursor: pointer;
        }


    </style>

</head>

<body>
    <div class="box">
        <ul class="img-list">
            <li class="current"><a href="#"><img src="img/01.jpg" alt=""></a></li>
            <li><a href="#"><img src="img/02.jpg" alt=""></a></li>
            <li><a href="#"><img src="img/03.jpg" alt=""></a></li>
            <li><a href="#"><img src="img/04.jpg" alt=""></a></li>
            <li><a href="#"><img src="img/05.jpg" alt=""></a></li>
        </ul>

        <ul class="indicator">
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
        </ul>
        <!-- <div class="img-click">
            <span class="prev">&lt;</span>
            <span class="next">&gt;</span>
        </div> -->


    </div>
    <script src="./jquery.js"></script>
</body>

</html>
<script>
    $(function(){

    var index = 0;
    var timer = setInterval(change, 1000);
    function change() {
        index++;
        if (index == 5) {
            index = 0
        }
        $('.img-list>li').eq(index).css('display', 'block')
            .siblings().css('display', 'none');
        $('.indicator>li').eq(index).css('background-color', 'red')
            .siblings().css('background-color', 'black')
        }
    $('.indicator>li').hover(function () {
        clearInterval(timer);
        $(this).css('background-color', 'red').siblings().css('background-color', 'black');
        var i = $(this).index();
        $('.img-list>li').eq(i).css('display', 'block').siblings().css('display', 'none');
    }, function () {
        timer = setInterval(change, 1000);
    })
    



    })

</script>